// 导入组件
import Vue from 'vue';
import Router from 'vue-router';
// 登录
import login from '@/views/login';
// 首页
import index from '@/views/index';
/**
 * 基础菜单
 */
// 数据总览
import userInfo from '@/views/userInfo/userInfo';
// 用户管理
import user from '@/views/user/user';
// 房间管理
import rootManage from '@/views/rootManage/rootManage';
// 房间流水
import rootTurnover from '@/views/rootTurnover/rootTurnover';

// 启用路由
Vue.use(Router);

// 导出路由 
export default new Router({
    routes: [{
        path: '/',
        name: '',
        component: login,
        hidden: true,
        meta: {
            requireAuth: false
        }
    }, {
        path: '/login',
        name: '登录',
        component: login,
        hidden: true,
        meta: {
            requireAuth: false
        }
    }, {
        path: '/index',
        name: '首页',
        component: index,
        iconCls: 'el-icon-tickets',
        children: [{
            path: '/userInfo/userInfo',
            name: '数据总览',
            component: userInfo,
            meta: {
                requireAuth: true
            }
        }, {
            path: '/user/user',
            name: '用户管理',
            component: user,
            meta: {
                requireAuth: true
            }
        }, {
            path: '/rootManage/rootManage',
            name: '房间管理',
            component: rootManage,
            meta: {
                requireAuth: true
            }
        }, {
            path: '/rootTurnover/rootTurnover',
            name: '房间流水',
            component: rootTurnover,
            meta: {
                requireAuth: true
            }
        }]
    }]
})